package com.persons.springbootproject.controller;

import com.persons.springbootproject.entity.Teacher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
public class TeacherController {

    @GetMapping("/testOne")
    public void testOne(){
        Teacher teacher=new Teacher(1,"舒文",32,"男","教数学");
        teacher.setCollege("数学系");
        teacher.job();
        teacher.enjoy();
        System.out.println(teacher);
    }

    @GetMapping("/testList")
    public List<Teacher> testList(){
        List<Teacher> list=new ArrayList<>();
        Teacher teacher=new Teacher();
        list.add(new Teacher(1,"舒文",32,"男","教数学"));
        list.add(new Teacher(2,"王老师",22,"女","教英语"));
        list.add(new Teacher(3,"张老师",43,"男","教物理"));

        return list;
    }

}
